//
//  AdMedicalRecordsViewModel.swift
//  EyeVisionForPatients
//
//  Created by liuyutian on 2022/8/19.
//  Copyright © 2022 QDSG. All rights reserved.
//

import UIKit
import HandyJSON

struct AdMedicalRecordsViewModel {

    static func getPatientMedicalRecords(patientId: String,
                                success: @escaping (_ isRecords: Bool) -> Void,
                                failure: @escaping (_ errorMsg: String?) -> Void) {
        let paras: [String: Any] = [
            "patientId": patientId,
        ]
        HttpTool.shared.request(target: ApiManager.patientMedicalRecords(paras: paras), success: { (json, code) in
            switch code {
            case .failure:
                failure(json["message"].description)
            case .success:
                success(json["data"].boolValue)
            }
        }) { errorMsg in
            failure(errorMsg)
        }
    }
    
    
}
